<div class="mz-user">

    <div class="userContent_header">
        <span class="userContent_title">账户中心</span>
        <span class="lastLogin_time">上次登录时间：{{lastLoginTime}}</span>
    </div>
    <div class="userContent_main">
        <img class="userAvatar" ng-src="img/avatar.png" alt="头像"/>
        <span class="userName" ng-model="user.userName">用户名：{{user.userName}}</span>
        <input type="button" class="changepwword" value="修改密码" data-toggle="modal"
               data-target="#changepw_box"/>
        <input type="button" class="logOut" value="退出登录" logout-confirm />
    </div>
</div>
<!-- 修改密码模态框（Modal） -->
<div class="modal fade changepw_box" id="changepw_box" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog changepw_dialog">
        <div class="modal-content">
            <span class="changepw_title">修改密码</span>
            <img class="changepw_img" ng-src="img/changepw.png" alt="修改密码"/>


            <form role="form" ng-submit="processForm(changepwForm.$valid)" name="changepwForm" novalidate>
                <div class="errorWarning_box">
                    <div class="" ng-show="changepwForm.oldPassword.$dirty && !changepwForm.oldPassword.$error.required">
                        <span class="errorWarning_mes" ng-show="changepwForm.oldPassword.$error.pwMatch">原密码错误，请重新输入</span>
                    </div>

                    <div class="" ng-show="changepwForm.newPassword.$dirty && !changepwForm.newPassword.$error.required">
                                <span ng-if="!changepwForm.oldPassword.$error.pwMatch">
                                    <span class="errorWarning_mes" ng-show="changepwForm.newPassword.$error.pwMatch">新密码与当前密码一致，请重新输入</span>
                                </span>
                    </div>

                    <div class="" ng-show="changepwForm.rePassword.$dirty && changepwForm.rePassword.$invalid">
                                <span ng-if="!changepwForm.newPassword.$error.pwMatch">
                                    <span class="errorWarning_mes" ng-show="changepwForm.rePassword.$error.pwMatch">预设密码和确认密码不一致</span>
                                </span>
                    </div>

                    <!--<div class="" ng-show="changepwForm.newPassword.$dirty && changepwForm.newPassword.$invalid ">-->
                    <!--<span class="errorWarning_mes"  ng-show="changepwForm.newPassword.$dirty && changepwForm.newPassword.$error.newPassword ">新密码不合法</span>-->
                    <!--</div>-->
                </div>
                <div class="changepw_pass">
                    <input class="oldPassword"
                           ng-class="{'hasError': changepwForm.oldPassword.$dirty && changepwForm.oldPassword.$invalid}"
                           ng-minlength=8 name="oldPassword" id="oldPassword" type="password" placeholder="旧密码"
                           required ng-model="formData.old" old-validate/>
                    <input class="newPassword"
                           ng-class="{'hasError': changepwForm.newPassword.$dirty && changepwForm.newPassword.$invalid}"
                           name="newPassword" id="newPassword" type="password" placeholder="新密码"
                           required ng-minlength=8 ng-pattern="/^[A-Za-z0-9]+$/" pw-check="oldPassword"
                           ng-model="formData.new"/>
                    <input class="rePassword"
                           ng-class="{'hasError': changepwForm.rePassword.$dirty && changepwForm.rePassword.$invalid}"
                           name="rePassword" id="rePassword" type="password" placeholder="重复新密码" required
                           ng-minlength=8 ng-pattern="/^[A-Za-z0-9]+$/" pw-check="newPassword"
                           ng-model="formData.confirm"/>
                </div>

                <span class="input_attention">密码需由8位以上的字母、数字组组成</span>

                <input type="submit" ng-disabled="changepwForm.$invalid" class="finishChangePw" value="完成"/>
                <input type="reset" class="cancelChangePw" value="取消" data-dismiss="modal"/>

            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

